package server.world.map


//Container for a certain Map
class LocationMap{
var name:String = "TEST" //Name of the Location
var tileList:List[Tile] = List() //List of Tiles in a location

def addTile(t:Tile){ tileList = t :: tileList } 


def contains(tile:Tile):Boolean = tileList.contains(tile)
def tileExists(x_cord:Int,y_cord:Int):Boolean = !tileList.filter{ i => i.xCor == x_cord & i.yCor == y_cord }.isEmpty
def getTile(x_cord:Int,y_cord:Int):Tile = tileList.filter(i => i.xCor == x_cord & i.yCor == y_cord).head

def findPath(start:Tile, finish:Tile):List[Tile] = {
  if(tileList.contains(start) & tileList.contains(finish)){
    val nodeList:List[Tile] = tileList
    nodeList.foreach(x => x.makeNode())
    
    return List()
  }
  else return List()
}

}